'use client';

import {createContext, useContext, useState} from 'react';
const Context = createContext({});

export enum ThemeMode {
  white = 'white',
  dark = 'dark',
}

export default function LayoutProvider({children}: Record<string, any>) {
  const [mode, setMode] = useState(ThemeMode.white);

  return (
    <Context.Provider value={{mode, setMode}}>
      <div className={mode}>{children}</div>
    </Context.Provider>
  );
}

export function useLayoutContext() {
  return useContext(Context);
}
